import request from '@/utils/request';
//import requestUpload from '@/utils/requestUpload';

export async function getFileDataByPage(params: any) {
  return request('/api/baseData/getFileDataByPage', {
    method: 'POST',
    data: params,
  });
}

export async function addFileData(params: any) {
  return request('/api/baseData/addFileData', {
    method: 'POST',
    data: params,
  });
}

export async function delFileData(params: any) {
  return request('/api/baseData/delFileData', {
    method: 'POST',
    data: params,
  });
}

export async function updateFileData(params: any) {
  return request('/api/baseData/updateFileData', {
    method: 'POST',
    data: params,
  });
}

export async function uploadFromMinio(params: any) {
  return request('/api/baseData/uploadFromMinio', {
    method: 'POST',
    requestType: 'form',
    data: params,
  });
}

/**
 * 下载excel
 * @param params
 * @returns
 */
export async function downloadFromMinio(params: any) {
  return request('/api/baseData/downloadFromMinio', {
    method: 'POST',
    responseType: 'blob',
    data: params,
  });
}

export async function downloadTemplateByName(params: any) {
  return request('/api/baseData/downloadTemplateByName', {
    method: 'POST',
    responseType: 'blob',
    data: params,
  });
}
